package com.magicsoft.share.adapter.my;

import android.support.annotation.LayoutRes;
import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.magicsoft.share.R;
import com.magicsoft.share.bean.my.OrderList;

import java.util.List;

/**
 * Created by lyf on 2017/11/7/007.
 */

public class OrderGoodsAdapter extends BaseQuickAdapter<OrderList.ListBean.GoodsListBean, BaseViewHolder> {


    public OrderGoodsAdapter(@LayoutRes int layoutResId, @Nullable List<OrderList.ListBean.GoodsListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, OrderList.ListBean.GoodsListBean item) {
        ImageView imageView = helper.getView(R.id.imageView);
        Glide.with(mContext).load(item.getGoodsImg()).into(imageView);

        helper.setText(R.id.tv_name, item.getGoodsName())
                .setText(R.id.tv_price, item.getPrice()+"")
                .setText(R.id.tv_num, "x"+item.getGoodsNum());


    }
}
